package NGUYENVANTHANG_kt;



public class TriangleEntity implements IGeometricObject {
	
	// 1. Datafield
    private double side01;
    private double side02;
    private double side03;

	@Override
	public double getArea(Object obj) { 
		double p = (((TriangleEntity) obj).getSide01() + 
            ((TriangleEntity) obj).getSide02() + 
            ((TriangleEntity) obj).getSide03()) / 2;

return Math.sqrt(p * 
            (p - ((TriangleEntity) obj).getSide01()) * 
            (p - ((TriangleEntity) obj).getSide02()) * 
            (p - ((TriangleEntity) obj).getSide03()));
		// TODO Auto-generated method stub
	
	}

	@Override
	
	
	public double getPerimeter(Object obj) {
		TriangleEntity objEntity = (TriangleEntity) obj;
		// TODO Auto-generated method stub
		return     objEntity.getSide01()+
                objEntity.getSide02()+
                objEntity.getSide03();
	}	
	
    

	public double getSide01() {
		return side01;
	}

	public void setSide01(double side01) {
		this.side01 = side01;
	}

	public double getSide02() {
		return side02;
	}

	public void setSide02(double side02) {
		this.side02 = side02;
	}

	public double getSide03() {
		return side03;
	}

	public void setSide03(double side03) {
		this.side03 = side03;
	}




	
	

	
	
	

}
